#anim
execute as @e[tag=guardTower,type=item_display,nbt={item:{components:{"minecraft:custom_data":{guardTowerData:{playingAnim:"await"}}}}},tag=isEnable] at @s run function vs:system/game_ctrol/guard_tower/anim/await/anim
execute as @e[tag=guardTower,type=item_display,nbt={item:{components:{"minecraft:custom_data":{guardTowerData:{playingAnim:"aiming"}}}}},tag=isEnable] at @s run function vs:system/game_ctrol/guard_tower/anim/aiming/anim with entity @s item.components."minecraft:custom_data".guardTowerData
execute as @e[tag=guardTower,type=item_display,nbt={item:{components:{"minecraft:custom_data":{guardTowerData:{playingAnim:"ready_attack"}}}}},tag=isEnable] at @s run function vs:system/game_ctrol/guard_tower/anim/ready_attack/anim with entity @s item.components."minecraft:custom_data".guardTowerData

#ai
execute as @e[tag=guardTower,type=item_display,tag=isEnable] unless score @s short_circuit_timer matches -2147483648..2147483647 at @s run function vs:system/game_ctrol/guard_tower/ai/ai
    #-E's Bullet AI
execute as @e[tag=guardTower-e.bullet,type=marker] at @s run function vs:system/game_ctrol/guard_tower/ai/attack/-e/bullet_ai with entity @s data

#Power System
execute as @e[tag=guardTower,type=item_display] at @s run function vs:system/game_ctrol/guard_tower/power/_power_system

#short circuit
execute as @e[tag=guardTower,type=item_display,scores={short_circuit_timer=-1..}] at @s run function vs:system/game_ctrol/guard_tower/short_circuit/ing
    #stream mob
    execute as @e[tag=guardTower,type=item_display] at @s if entity @e[distance=..10,tag=StreamMob,type=zombie] run function vs:system/game_ctrol/guard_tower/short_circuit/start_by_stream_mob

#HP
execute as @e[tag=guardTower,type=item_display] at @s if function vs:system/game_ctrol/guard_tower/health/if/hit_box_is_hurt run function vs:system/game_ctrol/guard_tower/health/hurt